home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / util / TimerTask.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  694 b   |  32 lines

  1. package java.util;
  2.  
  3. public abstract class TimerTask implements Runnable {
  4.    final Object lock = new Object();
  5.    int state = 0;
  6.    static final int VIRGIN = 0;
  7.    static final int SCHEDULED = 1;
  8.    static final int EXECUTED = 2;
  9.    static final int CANCELLED = 3;
  10.    long nextExecutionTime;
  11.    long period = 0L;
  12.  
  13.    protected TimerTask() {
  14.    }
  15.  
  16.    public abstract void run();
  17.  
  18.    public boolean cancel() {
  19.       synchronized(this.lock) {
  20.          boolean var2 = this.state == 1;
  21.          this.state = 3;
  22.          return var2;
  23.       }
  24.    }
  25.  
  26.    public long scheduledExecutionTime() {
  27.       synchronized(this.lock) {
  28.          return this.period < 0L ? this.nextExecutionTime + this.period : this.nextExecutionTime - this.period;
  29.       }
  30.    }
  31. }
  32.